# -*- coding: utf-8 -*-
import logging.handlers
class logger:
    _log=object
    def __init__(self):
        # self._log=logging
        # logging.handlers.RotatingFileHandler('log.log', maxBytes=1024 * 1024, backupCount=5, encoding='utf-8')
        # self._log.basicConfig(level=logging.DEBUG,
        #                     format='%(asctime)s [line:%(lineno)d] : %(message)s',
        #                     datefmt='%Y-%m-%d %H:%M:%S',
        #                     filename='log.log',
        #                     filemode='a')
        handler = logging.handlers.RotatingFileHandler('log.log','a',maxBytes=1024 * 1024, backupCount=5,encoding='utf-8')  # 实例化handler
        formatter = logging.Formatter('%(asctime)s [line:%(lineno)d] : %(message)s')  # 实例化formatter
        handler.setFormatter(formatter)  # 为handler添加formatter
        _logger = logging.getLogger('log')
        _logger.addHandler(handler)  # 为logger添加handler
        _logger.setLevel(logging.DEBUG)
        self._log=_logger
    def info(self,content):
        self._log.info(content)
